<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>220-正则对象上的exec方法.html</title>
</head>
<body>
	
</body>
<script>
	var str = "a2019-05-29b2019-05-30";
	// var reg = /(?<years>\d{4})-(?<month>\d{2})-(?<day>\d{2})/g;
	var reg = /\d{4}-\d{2}-\d{2}/;


	console.log(str);
	console.log(reg.lastIndex);
	console.log(reg.exec(str));
	console.log(reg.lastIndex);
	console.log(reg.exec(str));
</script>
</html>